
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <linux/fb.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <input_manager.h>

#define DEBUG printf("%s %s %d\n", __FILE__, __FUNCTION__, __LINE__)



int main(int argc, char **argv)
{
	int ret;
	InputEvent event;
	
	//初始化设备
	InputDevsRegister();
	InputDeviceInit();
	printf("Init over\n");
	//循环读取数据
	while(1)
	{
//		DEBUG;
		ret = GetInputEvent(&event);
		if(ret)
		{
			printf("GetInputEvent err\n");
			return -1;
		}
		else
		{	
			if(event.iType == INPUT_TYPE_TOUCH)
			{
				printf("Type : %d\n", event.iType);
				printf("iX : %d\n", event.iX);			
				printf("iY : %d\n", event.iY);
				printf("iPressure : %d\n", event.iPressure);
			}
			else if(event.iType == INPUT_TYPE_NET)
			{
				printf("Type : %d\n", event.iType);
				printf("str : %s\n", event.str);
			}
			else
			{
				printf("%s %s %d, type err\n", __FILE__, __FUNCTION__, __LINE__);
			}
			
			
		}
	}
	return 0;	
}

